<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>账号<input type="text" class="user"></p>
    <p>密码<input type="text" class="pwd"></p>
    <p><button>登录</button></p>
</body>
<script src="./axios.js"></script>
<script>
    const user = document.querySelector(".user");
    const pwd = document.querySelector(".pwd");
    const btn = document.querySelector("button");

    btn.addEventListener("click",() => {
        axios.post("/login",{
            userName:user.value,
            password:pwd.value
        }).then((res) => {
            console.log(res);
        })
    })
</script>
</html>